<include file="public:header"/>
<div class="toptip">
    <div class="toptit">提示：</div>
    <p>自定义广告位调用名不可以以 “QS_”开头</p>
</div>

<div class="toptit">新增分类</div>
<form action="{:U('category_add')}" method="post" name="FormData" id="FormData">
    <div class="form_main width120">
        <div class="fl">分类名称:</div>
        <div class="fr">
            <input name="categoryname" type="text" class="input_text_default middle" maxlength="30" value=""/>
        </div>
        <div class="fl">调用名:</div>
        <div class="fr">
            <input name="c_alias" type="text" class="input_text_default middle" maxlength="30" value=""/>
            <label class="no-fl-note">(自定义分类调用名不可以以“QS_”开头)</label>
        </div>
        <div class="fl"></div>
        <div class="fr">
            <input type="button" class="admin_submit" value="保存" id="J_submit"/>
            <input type="button" class="admin_submit" value="返回" onClick="window.location='{:U('category')}'"/>
        </div>
        <div class="clear"></div>
    </div>
</form>

</div>
<include file="public:footer"/>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        $('#J_submit').click(function(){
            var that = $(this);
            if(that.hasClass('disabled')){
                return false;
            }
            that.val('正在保存...').addClass('disabled');
            $.post("{:U('category_add')}",$('#FormData').serialize(),function(result){
                if(result.status==1){
                    disapperTooltip("success", result.msg,function(){
                        location.href='{:U("category")}';
                    });
                }else{
                    disapperTooltip("remind", result.msg,function(){
                        that.val('保存修改').removeClass('disabled');
                    });
                    return false;
                }
            },'json');
        });
    });
</script>
</html>